﻿// FileSystem.cs
// 
// Copyright (C) 2008 Jordi Martín Cardona
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
//

using System;
using System.IO;


namespace sdom.Utils
{
	
	
	public static class FileSystem
	{
		
		
		public static TextFile OpenTextFile(string path){
			TextFile tf = new TextFile();
			tf.OpenTextFile(path);
			return tf;
		}
		
		public static void CopyFile(
 string sourceFileName,
 string destFileName
){
			File.Copy(sourceFileName,destFileName);
		}
		
		
		public static void DeleteFile(
 string path
){
			File.Delete(path);
		}
		
		
		public static bool ExistsFile(
 string path
){
			return File.Exists(path);
		}
		
		public static void MoveFile(
 string sourceFileName,
 string destFileName
){
			File.Move(sourceFileName,destFileName);
		}
		
		
		public static void CreateDirectory(
 string path
){
			Directory.CreateDirectory(path);
		}
		

		public static void DeleteDirectory(
 string path
){
			Directory.Delete(path);
		}
		
		
		public static void DeleteDirectory(
 string path,
 bool recursive
){
			Directory.Delete(path,recursive);
		}
		

public static bool ExistsDirectories(
 string path
){
			return Directory.Exists(path);
		}

		public static string GetCurrentDirectory(){
			return Directory.GetCurrentDirectory();
		}

public static string[] GetDirectories(
 string path
){
			return Directory.GetDirectories(path);
		}

public static string[] GetDirectories(
 string path,
 string searchPattern
){
			return Directory.GetDirectories(path,searchPattern);
			
		}

public static string[] GetFiles(
 string path
){
			return Directory.GetFiles(path);
		}

public static string[] GetFiles(
 string path,
 string searchPattern
){
			return Directory.GetFiles(path);
		}

public static string GetParent(
 string path
){
			return Directory.GetParent(path).FullName;
		}

public static void MoveDirectory(
 string sourceDirName,
 string destDirName
){
			Directory.Move(sourceDirName,destDirName);
		}

public static void SetCurrentDirectory(
 string path
){
			Directory.SetCurrentDirectory(path);
		}

		
		
		
	}
}
